# Ruby RIBClient
PROJECT (RubyRIBClient)

# INCLUDE ( FindRubyEx )

INCLUDE_DIRECTORIES (
  .
  ../utils
  $ENV{CPPUNIT_ROOT}/include
  $ENV{OPENEXR_ROOT}/include
  $ENV{ILMBASE_ROOT}/include
  $ENV{DELIGHT}/include
  )
INCLUDE_DIRECTORIES ( $ENV{RUBY_INCLUDE} )
INCLUDE_DIRECTORIES ( ${RUBY_HDR_DIR} )
INCLUDE_DIRECTORIES ( ${RUBY_CONFIG_HDR_DIR} )

LINK_DIRECTORIES (
#  ../utils
  $ENV{CPPUNIT_ROOT}/lib
  $ENV{OPENEXR_ROOT}/lib
  $ENV{ILMBASE_ROOT}/lib
  $ENV{DELIGHT}/lib
  $ENV{RUBY_LIB}
  )

ADD_DEFINITIONS ( -DDELIGHT -DDELIGHT_RIBCLIENT )

IF(APPLE)
  SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -Wl,-flat_namespace,-U,_environ")
  SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -Wl,-flat_namespace,-U,_environ")
ENDIF(APPLE) 

SET_SOURCE_FILES_PROPERTIES( RIBClient.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES( RIBClient.i PROPERTIES SWIG_FLAGS "-includeall")

SWIG_ADD_MODULE ( ruby_ribclient ruby RIBClient.i ParameterList.cpp )

SWIG_LINK_LIBRARIES ( ruby_ribclient utils 3delight ruby-static )

IF (APPLE)
SET_TARGET_PROPERTIES ( ruby_ribclient PROPERTIES SUFFIX ".bundle")
ENDIF (APPLE)
